{% extends '::base.html.twig' %}

{% block body -%}
<div class="headerdiv">
    <div class="row">
        <div class="col-md-10">
            <h3>Convenios</h3>
        </div>
        <div class="col-md-2" style="padding-right: 30px; padding-top: 5px; padding-bottom: 5px; text-align: right;">
            <ul class="list-inline">
                <li >
                    <a href="{{ path('convenio_new') }}" class="btn btn-default btn-register">
                        <img src="{{ asset('bundles/histclinica/images/icons/plus-20.png') }}" width="20px" alt="Crear" title="Crear"/>
                        Registrar
                    </a>
                </li>                
            </ul>
        </div>
    </div>
</div>
<table class="records_list table table-striped table-condensed table-bordered">
    <thead>
        <tr>
            <th>Nombre</th>
            <th>Acciones</th>
        </tr>
    </thead>
    <tbody>
        {% for entity in entities if entity.activo %}
        <tr>
            <td>{{ entity.nombreConvenio }}</td>
            <td class="tdactions">
                <ul class="list-inline">
                    <li>
                        <a href="{{ path('convenio_edit', { 'id': entity.id }) }}"><img src="{{ asset('bundles/histclinica/images/icons/edit-20.png') }}" width="20px" alt="Editar" title="Editar"/></a>
                    </li>
                    <li>
                        <a href="{{ path('convenio_delete', { 'id': entity.id }) }}" onclick="javascript: return confirm('¿Esta seguro de eliminar el convenio?');" ><img src="{{ asset('bundles/histclinica/images/icons/cancel-22.png') }}" width="20px" alt="Borrar"  title="Borrar"/></a>
                    </li>
                    <li>
                        <a href="{{ path('costoProcedimiento_listado', { 'id': entity.id }) }}" ><img src="{{ asset('bundles/histclinica/images/icons/money24.png') }}" width="20px" alt="Tarifas" title="Tarifas"/></a>
                    </li>
                </ul>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
<form action="{{path('convenio_search')}}" method="post">
    <div class="col-md-3" style="padding-left: 30px; padding-top: 5px; padding-bottom: 5px;">
        <input autocomplete="off" required="" value="{%if search is defined%}{{search}}{%endif%}" type="search" class="form-control" name="search" placeholder="Buscar por Nombre"/> 
    </div>
    {%if search is defined%}
    <div class="col-md-1" style="padding-top: 8px; padding-bottom: 5px; width: 5%; padding-right: 0px; padding-left: 0px;">
        <a href="{{ path('convenio') }}" class="btn btn-default btn-register">
            <img src="{{ asset('bundles/histclinica/images/icons/cancel.png') }}" width="20px" alt="Quitar Filtro" title="Quitar Filtro"/>
        </a>
    </div>
    {%endif%}
    <div class="col-md-1" style="padding-left: 0px; padding-top: 5px; padding-bottom: 5px;">
        <input class="btn btn-default" type="submit" value="Buscar"/>
    </div>
</form> 

    {{ simple_paginator_render('convenio',null,{
                    'container_class':'pagination',
                    'firstPageText':'|<',
                    'firstEnabledClass':'',
                    'firstDisabledClass':'disabled',
                    'previousPageText': '<<',
                    'previousEnabledClass':'',
                    'previousDisabledClass':'disabled',
                    'currentClass': 'active',
                    'nextPageText': '>>',
                    'nextEnabledClass':'',
                    'nextDisabledClass':'disabled', 
                    'lastPageText':'>|',
                    'lastEnabledClass': '',
                    'lastDisabledClass': 'disabled'
                    })}}

    {% endblock %}
